package io.renren.modules.sq.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.sq.dao.SqSystemAuthorizationCodeDao;
import io.renren.modules.sq.dto.CodeListDto;
import io.renren.modules.sq.entity.SqSystemAuthorizationCodeEntity;
import io.renren.modules.sq.service.SqSystemAuthorizationCodeService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("sqSystemAuthorizationCodeService")
public class SqSystemAuthorizationCodeServiceImpl extends ServiceImpl<SqSystemAuthorizationCodeDao, SqSystemAuthorizationCodeEntity> implements SqSystemAuthorizationCodeService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SqSystemAuthorizationCodeEntity> page = this.page(
                new Query<SqSystemAuthorizationCodeEntity>().getPage(params),
                new QueryWrapper<SqSystemAuthorizationCodeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CodeListDto> getadmincodelist(String systemEditionId, String username) {
        return this.baseMapper.getadmincodelist(systemEditionId, username);
    }

    @Override
    public List<CodeListDto> getadmincodelistbyuid(Long userId, String systemEditionId, String username) {
        return this.baseMapper.getadmincodelistbyuid(userId, systemEditionId, username);
    }

    @Override
    public int getadmincodelistsnum() {
        return this.baseMapper.getadmincodelistnum();
    }

    @Override
    public int getadmincodelistbyuidnum(Long userId) {
        return this.baseMapper.getadmincodelistbyuidnum(userId);
    }

}
